package day2;

public class Fruit {
    public Object num(){
        return 10;
    }
    public void println(){
        System.out.println("水果");
    }
    public static void main(String[] args) {
        Fruit f1=new Apple();
        Fruit f2=new Orange();
        f1.println();
        f2.println();
    }
}
class Apple extends Fruit{
    public Integer num(){
        return 10;
    }
    public void println(){
        System.out.println("苹果");
    }

}
class Orange extends Fruit{
    public void println(){
        System.out.println("橘子");
    }
}
